﻿using System;
using NUnit.Framework;

namespace SeleniumToolkit.NUnit.Tests
{
    [WebFixture]
    public class when_webfixture_contains_normal_nunit_attributes
    {

        [WebTest, Ignore("This test demonstrates that Ignore attributes are applied to tests within a WebFixture")]
        public void ShouldBeIgnored()
        {
            Assert.IsTrue(false, "This test should not be executed.");
        }

        [WebTest, Explicit("This test demonstrates that Explicit attributes are applied to tests within a WebFixture")]
        public void ShouldBeExplicit()
        {
            Assert.IsTrue(false, "This test fails when run as part of a suite.  If running explicitly, the failure is expected.");
        }

        [WebTest, Category("Foobar")]
        public void ShouldHaveCategoryApplied()
        {
        }

        [WebTest, ExpectedException(typeof(Exception))]
        public void ShouldHaveExpectedException()
        {
            throw new Exception("Expected.");
        }

        [TestFixture]
        public class nested_class_with_normal_test_fixture_attribute
        {
            [Test]
            public void should_not_have_an_active_browser_session()
            {
                Assert.IsNull(Browser.Current);
            }
        }
    }
}
